package uni.UNIBEE7B8D.CommonTool;

import android.text.TextUtils;
import android.widget.BaseAdapter;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class HttpUrl {
    //用于不同用户群体 1特教群体 2康复群体
    public static int aspect = 2;

    //
    //用于不同APP端的类型 1患者端 2医师端
    public static int type = 1;

    //http://3m237632s3.wicp.vip   http://kfy.huaxiakangfu.com:8090
    static String BaseHttp = "http://kfy.huaxiakangfu.com:8090/jeecg-boot";

    //发送验证码 /app/msg/sendcode?type=1&phone=18865557988
    public  static String sendcode = BaseHttp+"/app/msg/sendcode?type=1";

    //手机号 验证码登录/user/user/loginByPhoneCode
    public static String login = BaseHttp+"/kfy/loginByPhoneCode";
    //账号 密码登录/user/user/loginByAccount
    public static String loginByAccount = BaseHttp+"/kfy/loginByAccount";
    public static String daohang = BaseHttp+"/data_type/dataType/list";
    //获取轮播图
    public static String homePage = BaseHttp+ "/app/home_page/queryList";
    //获取首页在看
    public static String homeZaikan = BaseHttp+"/app/home_page/getFriendLook";
    //首页班级
    public static String homeClass = BaseHttp+"/app/home_page/recommendedClass";
    //首页直播
    public static String homeZhibo = BaseHttp+"/live/live/list";
    //课程
    public static String homeKecheng = BaseHttp+"/app/home_page/recommendedCourses";
    //直播内容
    public static String zhiboCon = BaseHttp+"/live/live/queryById";
    //班级内容
    public static String banjiCon = BaseHttp+"/class/class/queryById";
    //课程内容
    public static String kechengCon = BaseHttp+"/course/course/queryById";



    public static String md5(String string) {
        if (TextUtils.isEmpty(string)) {
            return "";
        }
        MessageDigest md5 = null;
        try {
            md5 = MessageDigest.getInstance("MD5");
            byte[] bytes = md5.digest(string.getBytes());
            String result = "";
            for (byte b : bytes) {
                String temp = Integer.toHexString(b & 0xff);
                if (temp.length() == 1) {
                    temp = "0" + temp;
                }
                result += temp;
            }
            return result;
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
        }
        return "";
    }
}
